<?php
    
    require_once("fta.201003310000/fta.php");
    fta_registerModules(
        array(
        "cms.201003310000/config/cmsConfig",//we will deprecate the old cms config soon..
        "site/fta/config",
        "site/components/MAIExhibition",
        "FTAWebPage/ftaDefaultWidgets",
        "FTAWebPage/FTAWebPage",
        "FTAEvents/FTAEvents",
        "site/components/MAIEvent"
    )); 
        
    global $FTAWebPageDocumentType;
    $FTAWebPageDocumentType = 'docWebSnip';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $metadataKeywords; ?>" />
<meta name="Description" content="<?php echo $metadataDescription; ?>" />

<title><?php echo $pageTitle; ?> | Mairangi Arts Centre</title>

<?php include ("includes/external-files.php"); ?>



<script type="text/javascript" src="/js/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        timeout: '3000'
    });
});
</script>


<script type="text/javascript" src="/js/expand.js"></script>
<script type="text/javascript">
$(function() {
    $("h2.expand").toggler({method: "slideFadeToggle"});    
});
</script>


<script src="/js/jquery.inlined-forms.js" type="text/javascript"></script>    

<link type="text/css" media="screen" rel="stylesheet" href="/js/colorbox/colorbox.css" />
<script type="text/javascript" src="/js/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $(".popup").colorbox({iframe:true, width:"700", height:"710px"});
    });
</script>

<?php include ("includes/analytics.php"); ?>   
</head>

<body id="home" class="">



<?php include ("../html/includes/head.php"); ?>





<div id="container">


    <div id="content">
        
        <h1><?php echo $pageHeading; ?></h1>

         
        
        <div id="content-blocks">
            
            <div class="content-block block1 first-block">
 
            <div id="slideshow-outer">
                <div class="slideshow">
                        <?php echo mai_getSlideShow("2117", "2", "628", "273"); ?>
                </div>
            </div><!-- slideshow-outer ends -->


                <h2>
                <? /* <?php $this->valueForKey('description'); ?> */ ?>
                <?php echo fta_getPageContent("/Home-Page/Intro-Text/"); ?>
                     <?php /* >
                    Mairangi Arts Centre is a vibrant, community based visual arts education facility and exhibition venue. Our mission is to educate and foster growth in the creative arts by providing access to and participation in the arts for all. We offer:
                    <?php */ ?>
                </h2>
                



                <div id="home-features">
                
                
                <? /*<?php echo $pageContent; ?>*/ ?>
                
                    
                    <div>
                    
                    <h3><a href="/Classes/">Art Classes</a></h3>
                    <?php echo fta_getPageContent("/Home-Page/Art-Classes/"); ?>
                     <?php /* >
                        <ul>
                        <li>Weekly art classes and 'one off' weekend workshops</li>
                        <li>Studio space for experienced students who wish to work independently</li>
                        <li>Weekly after school and weekend art classes & school holiday programmes for children & young adults</li>
                        </ul>
                        <?php */ ?>
                    </div>                
    
                    <div>
                    
                    <h3><a href="/Exhibitions/">Exhibitions</a></h3>
                    <?php echo fta_getPageContent("/Home-Page/Exhibitions/"); ?>
                    <?php /* >
                        <ul>
                        <li>A varied exhibition programme, open to the public 6 days a week.</li>
                        <li>Opportunities to exhibit in our modern, spacious galleries</li>
                        <li>Dedicated venue for emerging artists to exhibit in a supportive, encouraging environment</li>
                        </ul>
                        <?php */ ?>
                    </div>  
                                  
                   <div class="last-item">
                    
                   <h3><a href="/Membership/">Membership</a></h3>
                   <?php echo fta_getPageContent("/Home-Page/Membership/"); ?>
                    <?php /* >
                        <ul>
                        <li>Discounts on classes & arts supplies</li>
                        <li>Monthly newsletter</li>
                        <li>Opportunities to become actively involved at your arts centre</li>
                        </ul>
                        <?php */ ?>
                    </div>  
                    
                    
                </div><!-- home-features ends -->
                
                
                
                
                
                <em>
                <?php echo fta_getPageContent("/Home-Page/Footer-Text/"); ?>
                
                    <?php 
                    
                    echo encodeMailto("mailto:mairangiartscentre@xtra.co.nz", "Click here") . " to email us.";
                    
                    /* >
                    At Mairangi Arts Centre our focus is on promoting a friendly, nurturing atmosphere to enable you to discover and develop your creativity. We welcome your enquiries.
                    <?php */ ?>
                </em>
                
            </div><!-- Content-block ends -->

        </div><!-- Content-blocks ends -->
        
        
        
    
    
    
        <div id="supplementary-content">
            
            <div id="home-buttons">
                
               <h2 class="expand">Sign up!</h2>
               <?php 
               $submit = extractNumberWithKeyFromArray('email-signup-submit', $_REQUEST, 0);
               
               $firstName = extractStringWithKeyFromArray("attribute1",$_POST,null);
               $lastName = extractStringWithKeyFromArray("attribute2",$_POST,null);
               $email = extractStringWithKeyFromArray("email",$_POST,null);
               
               $formHasBeenSubmitted = false;
               
               //$submit = true;
               if($submit == 1){
                    
                    $invalid2 = array();    
                
                    if(empty($firstName) || $firstName == "First Name:"){
                        $invalid2['message'] = 'Please enter all the fields.';
                    }
                    
                    if(empty($lastName) || $lastName == "Last Name:"){
                        $invalid2['message'] = 'Please enter all the fields.';
                    }
                    
                    // email
                    if(empty($email))
                        $invalid2['message'] = 'Please enter all the fields.';
                    else if(!isEmailAddress($email))
                        $invalid2['message'] = 'Please enter all the fields.';
                
                        
                    if(count($invalid2)==0){
            
                        $subemail = $email;
                        $subname = "";
                        $subuniqid = md5($email);
                        $confirmed = 1;
                        $disabled = 0;
                        $subentered = date("Y-m-d h:i:s");
                        $submodified = date("YmdHis");
                            
                        $query1 = "INSERT INTO phplist_user_user (entered, modified, email, confirmed, disabled, htmlemail, subscribepage,uniqid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
                                    $fields = array(
                                    $subentered,
                                    $submodified,
                                    $subemail,
                                    $confirmed,
                                    $disabled,
                                    1,
                                    1,
                                    $subuniqid
                                );
                        $db->prepareAndExecuteQuery($query1, $fields);
                                        
                        $id = mysql_insert_id();    
    
                        $query2 = "INSERT INTO phplist_listuser (userid, listid, entered, modified)
                                        VALUES ('".$id."', '2', '".date("Y-m-d h:i:s")."',
                                        '".date("YmdHis")."')";
                                    
                        $db->executeQuery($query2);
                                    
                        $attributeQuery = "INSERT INTO phplist_user_user_attribute (attributeid, userid, value) VALUES ('1','". $id ."','" . $firstName . "');";
                        $db->executeQuery($attributeQuery);         
                            
                        $attributeQuery = "INSERT INTO phplist_user_user_attribute (attributeid, userid, value) VALUES ('2','". $id ."','" . $lastName . "');";
                        $db->executeQuery($attributeQuery); 
                                
                        $formHasBeenSubmitted = true;                                                                           
                    }
               }    
               
               if($formHasBeenSubmitted){
                ?>
                <div class="newsletterThanks">
                    Thank you for joining our newsletter!
                </div>
                <?php
               } else {
               ?>
                <div <?php if($submit != 1){ echo "class='collapse'"; } ?>>
                    <?php /* ?>
                    <form id="sign-up-form" action="/" method="POST" >
                        <div>
                            <label for="name" class="inlined">Name:</label>
                            <input class="input-text" id="sign-up-name" name="name" />
                        </div>
                        
                        <div>
                            <label for="email" class="inlined">Email:</label>
                            <input class="input-text"  name="email" />
                        </div>
                        <input name="email-signup-submit" id="email-signup-submit" type="submit" value="1" />
                    </form>
                    <?php */ ?>
                    
                    <form method="POST" id="sign-up-form" name="sign-up-form" action="/">
                        <div>
                            <label for="attribute1" class="inlined">First Name:</label>
                            <input class="input-text" type="text" id="attribute1" name="attribute1" />
                        </div>
                        
                        <div>
                            <label for="attribute2" class="inlined">Last Name:</label>
                            <input class="input-text" type="text" id="attribute2" name="attribute2" />
                        </div>
                        
                        <div>
                            <label for="email" class="inlined">Email:</label>
                            <input class="input-text" type="text" id="email" name="email"/>
                        </div>
                        
                        <input type="hidden" name="list[2]" value="signup"  />
                        <input type=hidden name="listname[2]" value="Mairangi Arts Centre Newsletter"/>
                        
                        <div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div>
                        <input name="email-signup-submit" id="email-signup-submit" type="submit" value="1" />
                    </form>
                    <? if(isset($invalid2['message'])){ echo $invalid2['message'] . "<br /><br />"; } ?>
                </div>
                <?php 
               }
                ?>
                
                <a id="button-donate" href="/Donations-Bequests/" <?php //class="popup" ?> title="Donations &amp; Bequests">Donations &amp; Bequests</a>    
                <a id="button-exhibit" href="/Exhibitions/Entry-Forms/" title="Exhibit your work! Click here to download entry forms">Exhibit your work! Click here to download entry forms</a>
            </div>

            <?/*<div style="margin: 20px auto 0; width: 155px;">
                <object type="application/x-shockwave-flash" data="/images/santa_mac.swf" width="155" height="250">
                    <param name="movie" value="/images/santa_mac.swf" />
                    <param name="wmode" value="transparent"/>
                    <param name="menu" value="false"/>
                    <param name="quality" value="high"/>
                    <param name="allowFullScreen" value="false"/>
                    <p><img src="/images/santa_mac.jpg" alt="Merry Christmas!"></p>
                </object>
            </div>*/?>

            <div id="home-news">
                <h3>What's on</h3>
                
                <ul id="home-news-list">
                <?php echo mai_getWhatsOn(); ?>
                <?php /* ?>
                    <li>
                        <div class="date"><strong>May</strong> <br />2010</div>
                        <div class="news-item">
                            <h4><a href="#">A1: Advanced Printmaking</a></h4>
                            <div class="news-category">Art Classes</div>
                            Explore the exciting possibilities of printmaking with an experienced tutor and fellow students in a workshop environment.
                        </div>
                    </li>
                    
                    <li>
                        <div class="date"><strong>May</strong> <br />2010</div>
                        <div class="news-item">
                            <h4><a href="#">A1: Advanced Printmaking</a></h4>
                            <div class="news-category">Art Classes</div>
                            Explore the exciting possibilities of printmaking with an experienced tutor and fellow students in a workshop environment.
                        </div>
                    </li>

                    <li>
                        <div class="date"><strong>May</strong> <br />2010</div>
                        <div class="news-item">
                            <h4><a href="#">A1: Advanced Printmaking</a></h4>
                            <div class="news-category">Art Classes</div>
                            Explore the exciting possibilities of printmaking with an experienced tutor and fellow students in a workshop environment.
                        </div>
                    </li>
                    <?php */ ?>

                </ul>
                
            </div><!-- home-news ends -->
            
            
        </div><!-- Supplementary-content ends -->



    </div><!-- Content ends -->








    
</div><!-- Container ends -->





<?php include ("includes/foot.php"); ?>





</body>

</html>
